package fr.afcepf.atod12.projet1.managedbeans;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller("mbConnexion")
@Scope("session")
public class ConnexionBean {

	private String afcepf = "afcepf";
	private String username = "afcepf";
	private String password = "afcepf";
	private String errorLogin = "";
	private boolean login = false;
	
	
	public String connexion(){
		
		if(afcepf.equalsIgnoreCase(username) && afcepf.equals(password)){
			login = true;
			return "acceuil";
		}else{
			login = false;
			errorLogin = "Login ou mot de passe incorrecte";
			return "";
		}
	}
	
	
	
	public final String getUsername() {
		return username;
	}
	public final void setUsername(String username) {
		this.username = username;
	}
	public final String getPassword() {
		return password;
	}
	public final void setPassword(String password) {
		this.password = password;
	}



	public final String getErrorLogin() {
		return errorLogin;
	}



	public final void setErrorLogin(String errorLogin) {
		this.errorLogin = errorLogin;
	}



	public final boolean isLogin() {
		return login;
	}



	public final void setLogin(boolean login) {
		this.login = login;
	}

	
	
}
